# Maintainer: Robin Broda <robin@broda.me>
# Contributor: Michael Lass <bevan@bi-co.net>
# Contributor: Justin Dray <justin@dray.be>
# Contributor: Patrick McCarty <pnorcks at gmail dot com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Thomas S Hatch <thatch45 ar gmail dot com>
# Contributor: Michael P <ptchinster@archlinux.us>
# Contributor: Matt Heagney <matt@heagney.com>

pkgname=multipath-tools
_tag='24bc5cadb4b98443e754b7f9f3228b87ecea83de' # git rev-parse ${pkgver}
pkgver=0.9.5
pkgrel=1
pkgdesc='Multipath tools for Linux (including kpartx)'
arch=('loong64' 'x86_64')
url='https://github.com/opensvc/multipath-tools'
license=('GPL2')
depends=('libaio' 'device-mapper' 'json-c' 'liburcu' 'systemd-libs')
makedepends=('git' 'systemd')
source=("multipath-tools::git+https://github.com/opensvc/multipath-tools#tag=${_tag}")
sha256sums=('SKIP')

build() {
  cd "${pkgname}"

  make \
    prefix='/usr/' \
    bindir='/usr/bin' \
    LIB='lib' \
    FORTIFY_OPT=''
}

package() {
  cd "${pkgname}"

  make -j1 \
    DESTDIR="${pkgdir}" \
    prefix='/usr/' \
    bindir='/usr/bin' \
    LIB='lib' \
    install

  install -D -m0644 -t "${pkgdir}/usr/share/doc/${pkgname}" README*
}
